/* 自定义样式文件 */

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 消息气泡动画 */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    animation: messageSlideIn 0.3s ease-out;
}

/* 输入框自动调整高度 */
.auto-resize {
    resize: none;
    min-height: 44px;
    max-height: 120px;
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s infinite;
}

/* 渐变背景 */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 玻璃拟态效果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* 按钮悬停效果 */
.btn-hover {
    transition: all 0.2s ease;
}

.btn-hover:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-container {
        margin: 0;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }
    
    .control-bar {
        flex-direction: column;
        gap: 8px;
    }
    
    .quick-actions {
        justify-content: center;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
    
    .glass-effect {
        background: rgba(0, 0, 0, 0.25);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* 打字机效果 */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid;
    white-space: nowrap;
    animation: typewriter 3s steps(40) 1s 1 normal both,
               blink 0.75s step-end infinite;
}

@keyframes blink {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: currentColor;
    }
}

/* 消息标记样式 */
.message-markdown {
    line-height: 1.6;
}

.message-markdown h1,
.message-markdown h2,
.message-markdown h3,
.message-markdown h4,
.message-markdown h5,
.message-markdown h6 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.message-markdown p {
    margin-bottom: 1em;
}

.message-markdown code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 0.3em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.message-markdown pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 1em;
    border-radius: 0.5em;
    overflow-x: auto;
    margin: 1em 0;
}

.message-markdown pre code {
    background: none;
    padding: 0;
}

.message-markdown blockquote {
    border-left: 4px solid rgba(0, 0, 0, 0.1);
    padding-left: 1em;
    margin-left: 0;
    color: #666;
}

.message-markdown ul,
.message-markdown ol {
    margin: 1em 0;
    padding-left: 2em;
}

.message-markdown li {
    margin: 0.5em 0;
}

.message-markdown table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.message-markdown th,
.message-markdown td {
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.5em;
    text-align: left;
}

.message-markdown th {
    background: rgba(0, 0, 0, 0.05);
    font-weight: 600;
}